<?php

namespace app\admin\controller;

use think\Controller;
use think\Request;

class Order extends Controller
{
    public function __construct()
    {
        parent::__construct();

        $this->OrderModel = model('common/Order/Order');
    }

    public function index()
    {
        ini_set("error_reporting", "E_ALL & ~E_NOTICE");


        //每页显示多少条数据
        $limit = 10;

        //查询数据总数
        $count = $this->OrderModel->count();
        $OrderModel = $this->OrderModel->order('id', 'asc')->paginate($limit);

        // $getdql =  $this->AdminModel->where($where)->order('id', 'asc')->fetchSql(true)->paginate($limit);
        // var_dump($getdql);

        //定义序号
        $start = ($OrderModel->currentPage() - 1) * $OrderModel->listRows();
        $this->assign([
            'count' => $count,
            'AdminList' => $OrderModel,
            'start' => $start,
            'placeholder' => $OrderModel,
        ]);


        return $this->fetch();
    }
}
